<template>
	<view style="page-container">
		<view class="text-area">
			<text>输入值：</text><input type="text" v-model="title" style="color: red; font-weight: 500; background-color: #cccccc;" />
		</view>
		<view class="text-area">
			<text>回传值：</text>
			<input type="text" :value="callBackValue" style="color: yellow; font-weight: 500; background-color: #cccccc;"/>
		</view>
		<view class="component-box">
			<comA :intent="title"></comA>
		</view>
		<view class="component-box">
			<comB @callBackFun="callBack"></comB>
		</view>
	</view>
</template>

<script>
	import comA from '../../components/compA.vue'
	import comB from '../../components/comB.vue'
	export default {
		data() {
			return {
				title: 'Hello',
				callBackValue: ''
			}
		},
		components: {
			comA,
			comB
		},
		methods: {
			callBack(msg) {
				console.warn("----index----callBack-->" + msg);
				this.callBackValue = msg;
			}
		}
	}
</script>

<style>
	.page-container{
		padding-top: 20px;
		padding-left: 15px;
		padding-right: 15px;
	}
	.text-area {
		display: flex;
		align-items: center;
		margin-bottom: 15px;
		font-size: 16px;
	}
	.text-area text{
		margin-right: 8px;
	}
	.component-box{
		margin-bottom: 10px;
	}
</style>